<!-- 页面外套 -->
<div class="page-wrapper" id="setup_attendance_overtime">

    <!-- 数据网格 -->
    <div class="datagrid datagrid-striped" id="setup_attendance_overtime_datagrid">

        <!-- 工具条组 -->
        <div class="tool-group">
            <div class="tool-deal">
                <label><button class="btn btn-primary" id="setup_attendance_overtime_add_btn">  <i class="icon icon-plus"></i> 添加</button></label>
                <label><button class="btn btn-primary" id="setup_attendance_overtime_base_btn"> <i class="icon icon-cog"></i> 加班基础设置</button></label>
                <div class="clearfix"></div>
            </div>
        </div>
        <!-- tool-group -->

        <div class="datagrid-container"></div>
        <ul class="pager btn-mini" data-elements="prev,pages,next"></ul>
    </div>
    <!-- datagrid -->

    <!-- 添加盒子 -->
    <div class="modal modal-for-page fade" aria-hidden="false" id="setup_attendance_overtime_add_box">
        <div class="modal-dialog modal-fullscreen">
            <div class="modal-content">
                <div class="modal-header">
                    <button class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">关闭</span></button>
                    <h4 class="modal-title">添加</h4>
                </div>
                <div class="modal-body">
                    <form class="container form-horizontal">

                        <!-- 规则名称 -->
                        <table class="table table-bordered setup_attendance_overtime_table">
                            <thead><tr><th><span>规则名称</span></th></tr></thead>
                            <tbody><tr><td>
                                <div class="col-sm-3"><input type="text" class="form-control" id="setup_attendance_overtime_add_name"></div>
                            </td></tr></tbody>
                        </table>
                        <!-- 工作日加班 -->
                        <table class="table table-bordered setup_attendance_overtime_table">
                            <thead>
                                <tr>
                                    <th>
                                        <span>工作日加班</span>
                                        <div class="btn-group pull-right" data-toggle="buttons">
                                            <label class="btn btn-mini btn-default active"><input type="radio">启用</label>
                                            <label class="btn btn-mini btn-default"><input type="radio">禁用</label>
                                        </div>
                                    </th>
                                </tr>
                            </thead>
                            <tbody>
                                <tr>
                                    <td>
                                        <div class="table-disabled-mask"></div>
                                        <ul radio="1" time1="" time2="" id="setup_attendance_overtime_add_table1_ul">
                                            <li>
                                                <dl><dt><span class="for-label"><i class="icon icon-dot-circle"></i> 需要审批，以批准单为准</span></dt></dl>
                                            </li>
                                            <li>
                                                <dl>
                                                    <dt><span class="for-label"><i class="icon icon-circle-blank"></i> 需要审批，以打卡时间为准，但是不能超过审批单时长</span></dt>
                                                    <dd>
                                                        <div class="input-group pull-left">
                                                            <span class="input-group-addon">加班起算时间</span>
                                                            <input type="number" class="form-control" readonly>
                                                            <span class="input-group-addon">分钟</span>
                                                        </div>
                                                        <div class="small text-muted pull-left">最后一次下班时间超过该分钟数后，开始计算加班</div>
                                                        <div class="clearfix"></div>
                                                    </dd>
                                                    <dd>
                                                        <div class="input-group pull-left">
                                                            <span class="input-group-addon">最小加班时长</span>
                                                            <input type="number" class="form-control" readonly>
                                                            <span class="input-group-addon">分钟</span>
                                                        </div>
                                                        <div class="small text-muted pull-left">分钟小于该时长则加班时长记为0</div>
                                                        <div class="clearfix"></div>
                                                    </dd>
                                                </dl>
                                            </li>
                                            <li>
                                                <dl>
                                                    <dt><span class="for-label"><i class="icon icon-circle-blank"></i> 无需审批，根据打卡时间算加班时间</span></dt>
                                                    <dd>
                                                        <div class="input-group pull-left">
                                                            <span class="input-group-addon">加班起算时间</span>
                                                            <input type="number" class="form-control" readonly>
                                                            <span class="input-group-addon">分钟</span>
                                                        </div>
                                                        <div class="small text-muted pull-left">最后一次下班时间超过该分钟数后，开始计算加班</div>
                                                        <div class="clearfix"></div>
                                                    </dd>
                                                    <dd>
                                                        <div class="input-group pull-left">
                                                            <span class="input-group-addon">最小加班时长</span>
                                                            <input type="number" class="form-control" readonly>
                                                            <span class="input-group-addon">分钟</span>
                                                        </div>
                                                        <div class="small text-muted pull-left">分钟小于该时长则加班时长记为0</div>
                                                        <div class="clearfix"></div>
                                                    </dd>
                                                </dl>
                                            </li>
                                        </ul>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <div class="table-disabled-mask"></div>
                                        <ol>
                                            <li>
                                                <dl>
                                                    <dt>
                                                        <span class="for-label" id="setup_attendance_overtime_add_table1_ol_check1">
                                                            <i class="icon icon-check-empty"></i> 
                                                            扣除休息时间
                                                        </span>
                                                    </dt>
                                                    <dd>
                                                        <div class="input-group pull-left">
                                                            <input type="time" class="form-control" id="setup_attendance_overtime_add_table1_ol_duration1" readonly>
                                                            <span class="input-group-addon">至</span>
                                                            <input type="time" class="form-control" id="setup_attendance_overtime_add_table1_ol_duration2" readonly>
                                                        </div>
                                                        <div class="clearfix"></div>
                                                    </dd>
                                                </dl>
                                            </li>
                                            <li>
                                                <dl>
                                                    <dt>
                                                        <span class="for-label has-table" id="setup_attendance_overtime_add_table1_ol_check2">
                                                            <i class="icon icon-check-empty"></i> 
                                                            计为加班费/调休
                                                        </span>
                                                    </dt>
                                                    <dd>
                                                        <table class="table" radio="" time="" id="setup_attendance_overtime_add_table1_ol_table">
                                                            <tr>
                                                                <td colspan="2">
                                                                    <span class="for-label"><i class="icon icon-circle-blank"></i> 计为加班费</span>
                                                                </td>
                                                            </tr>
                                                            <tr>
                                                                <td style="width:220px;"><span class="for-label"><i class="icon icon-circle-blank"></i> 计为调休时长</span></td>
                                                                <td>
                                                                    <div class="input-group pull-left">
                                                                        <span class="input-group-addon">调休比例 1：</span>
                                                                        <input type="number" class="form-control" readonly>
                                                                    </div>
                                                                </td>
                                                            </tr>
                                                            <tr>
                                                                <td><span class="for-label"><i class="icon icon-circle-blank"></i> 计为加班费/调休(员工自行选择)</span></td>
                                                                <td>
                                                                    <div class="input-group pull-left">
                                                                        <span class="input-group-addon">调休比例 1：</span>
                                                                        <input type="number" class="form-control" readonly>
                                                                    </div>
                                                                </td>
                                                            </tr>
                                                        </table>
                                                    </dd>
                                                </dl>
                                            </li>
                                        </ol>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                        <!-- 休息日加班 -->
                        <table class="table table-bordered setup_attendance_overtime_table">
                            <thead>
                                <tr>
                                    <th>
                                        <span>休息日加班</span>
                                        <div class="btn-group pull-right" data-toggle="buttons">
                                            <label class="btn btn-mini btn-default active"><input type="radio">启用</label>
                                            <label class="btn btn-mini btn-default"><input type="radio">禁用</label>
                                        </div>
                                    </th>
                                </tr>
                            </thead>
                            <tbody>
                                <tr>
                                    <td>
                                        <div class="table-disabled-mask"></div>
                                        <ul radio="1" time1="" time2="" id="setup_attendance_overtime_add_table2_ul">
                                            <li>
                                                <dl><dt><span class="for-label"><i class="icon icon-dot-circle"></i> 需要审批，以批准单为准</span></dt></dl>
                                            </li>
                                            <li>
                                                <dl>
                                                    <dt><span class="for-label"><i class="icon icon-circle-blank"></i> 需要审批，以打卡时间为准，但是不能超过审批单时长</span></dt>
                                                    <dd>
                                                        <div class="input-group pull-left">
                                                            <span class="input-group-addon">最小加班时长</span>
                                                            <input type="number" class="form-control" readonly>
                                                            <span class="input-group-addon">分钟</span>
                                                        </div>
                                                        <div class="small text-muted pull-left">当天加班少于该分钟数不计入加班</div>
                                                        <div class="clearfix"></div>
                                                    </dd>
                                                </dl>
                                            </li>
                                            <li>
                                                <dl>
                                                    <dt><span class="for-label"><i class="icon icon-circle-blank"></i> 无需审批，根据打卡时间算加班时间</span></dt>
                                                    <dd>
                                                        <div class="input-group pull-left">
                                                            <span class="input-group-addon">最小加班时长</span>
                                                            <input type="number" class="form-control" readonly>
                                                            <span class="input-group-addon">分钟</span>
                                                        </div>
                                                        <div class="small text-muted pull-left">当天加班少于该分钟数不计入加班</div>
                                                        <div class="clearfix"></div>
                                                    </dd>
                                                </dl>
                                            </li>
                                        </ul>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <div class="table-disabled-mask"></div>
                                        <ol>
                                            <li>
                                                <dl>
                                                    <dt>
                                                        <span class="for-label" id="setup_attendance_overtime_add_table2_ol_check1">
                                                            <i class="icon icon-check-empty"></i> 
                                                            扣除休息时间
                                                        </span>
                                                    </dt>
                                                    <dd>
                                                        <div class="input-group pull-left">
                                                            <input type="time" class="form-control" id="setup_attendance_overtime_add_table2_ol_duration1" readonly>
                                                            <span class="input-group-addon">至</span>
                                                            <input type="time" class="form-control" id="setup_attendance_overtime_add_table2_ol_duration2" readonly>
                                                        </div>
                                                        <div class="clearfix"></div>
                                                    </dd>
                                                </dl>
                                            </li>
                                            <li>
                                                <dl>
                                                    <dt>
                                                        <span class="for-label has-table" id="setup_attendance_overtime_add_table2_ol_check2">
                                                            <i class="icon icon-check-empty"></i> 
                                                            计为加班费/调休
                                                        </span>
                                                    </dt>
                                                    <dd>
                                                        <table class="table" radio="" time="" id="setup_attendance_overtime_add_table2_ol_table">
                                                            <tr>
                                                                <td colspan="2">
                                                                    <span class="for-label"><i class="icon icon-circle-blank"></i> 计为加班费</span>
                                                                </td>
                                                            </tr>
                                                            <tr>
                                                                <td style="width:220px;"><span class="for-label"><i class="icon icon-circle-blank"></i> 计为调休时长</span></td>
                                                                <td>
                                                                    <div class="input-group pull-left">
                                                                        <span class="input-group-addon">调休比例 1：</span>
                                                                        <input type="number" class="form-control" readonly>
                                                                    </div>
                                                                </td>
                                                            </tr>
                                                            <tr>
                                                                <td><span class="for-label"><i class="icon icon-circle-blank"></i> 计为加班费/调休(员工自行选择)</span></td>
                                                                <td>
                                                                    <div class="input-group pull-left">
                                                                        <span class="input-group-addon">调休比例 1：</span>
                                                                        <input type="number" class="form-control" readonly>
                                                                    </div>
                                                                </td>
                                                            </tr>
                                                        </table>
                                                    </dd>
                                                </dl>
                                            </li>
                                        </ol>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                        <!-- 节假日加班 -->
                        <table class="table table-bordered setup_attendance_overtime_table">
                            <thead>
                                <tr>
                                    <th>
                                        <span>节假日加班</span>
                                        <small class="text-danger" style="font-weight:normal;">&nbsp; 注：节假日指节日当天（如5月1日、10月1日等）</small>
                                        <div class="btn-group pull-right" data-toggle="buttons">
                                            <label class="btn btn-mini btn-default active"><input type="radio">启用</label>
                                            <label class="btn btn-mini btn-default"><input type="radio">禁用</label>
                                        </div>
                                    </th>
                                </tr>
                            </thead>
                            <tbody>
                                <tr>
                                    <td>
                                        <div class="table-disabled-mask"></div>
                                        <ul radio="1" time1="" time2="" id="setup_attendance_overtime_add_table3_ul">
                                            <li>
                                                <dl><dt><span class="for-label"><i class="icon icon-dot-circle"></i> 需要审批，以批准单为准</span></dt></dl>
                                            </li>
                                            <li>
                                                <dl>
                                                    <dt><span class="for-label"><i class="icon icon-circle-blank"></i> 需要审批，以打卡时间为准，但是不能超过审批单时长</span></dt>
                                                    <dd>
                                                        <div class="input-group pull-left">
                                                            <span class="input-group-addon">最小加班时长</span>
                                                            <input type="number" class="form-control" readonly>
                                                            <span class="input-group-addon">分钟</span>
                                                        </div>
                                                        <div class="small text-muted pull-left">当天加班少于该分钟数不计入加班</div>
                                                        <div class="clearfix"></div>
                                                    </dd>
                                                </dl>
                                            </li>
                                            <li>
                                                <dl>
                                                    <dt><span class="for-label"><i class="icon icon-circle-blank"></i> 无需审批，根据打卡时间算加班时间</span></dt>
                                                    <dd>
                                                        <div class="input-group pull-left">
                                                            <span class="input-group-addon">最小加班时长</span>
                                                            <input type="number" class="form-control" readonly>
                                                            <span class="input-group-addon">分钟</span>
                                                        </div>
                                                        <div class="small text-muted pull-left">当天加班少于该分钟数不计入加班</div>
                                                        <div class="clearfix"></div>
                                                    </dd>
                                                </dl>
                                            </li>
                                        </ul>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <div class="table-disabled-mask"></div>
                                        <ol>
                                            <li>
                                                <dl>
                                                    <dt>
                                                        <span class="for-label" id="setup_attendance_overtime_add_table3_ol_check1">
                                                            <i class="icon icon-check-empty"></i> 
                                                            扣除休息时间
                                                        </span>
                                                    </dt>
                                                    <dd>
                                                        <div class="input-group pull-left">
                                                            <input type="time" class="form-control" id="setup_attendance_overtime_add_table3_ol_duration1" readonly>
                                                            <span class="input-group-addon">至</span>
                                                            <input type="time" class="form-control" id="setup_attendance_overtime_add_table3_ol_duration2" readonly>
                                                        </div>
                                                        <div class="clearfix"></div>
                                                    </dd>
                                                </dl>
                                            </li>
                                            <li>
                                                <dl>
                                                    <dt>
                                                        <span class="for-label has-table" id="setup_attendance_overtime_add_table3_ol_check2">
                                                            <i class="icon icon-check-empty"></i> 
                                                            计为加班费/调休
                                                        </span>
                                                    </dt>
                                                    <dd>
                                                        <table class="table" radio="" time="" id="setup_attendance_overtime_add_table3_ol_table">
                                                            <tr>
                                                                <td colspan="2">
                                                                    <span class="for-label"><i class="icon icon-circle-blank"></i> 计为加班费</span>
                                                                </td>
                                                            </tr>
                                                            <tr>
                                                                <td style="width:220px;"><span class="for-label"><i class="icon icon-circle-blank"></i> 计为调休时长</span></td>
                                                                <td>
                                                                    <div class="input-group pull-left">
                                                                        <span class="input-group-addon">调休比例 1：</span>
                                                                        <input type="number" class="form-control" readonly>
                                                                    </div>
                                                                </td>
                                                            </tr>
                                                            <tr>
                                                                <td><span class="for-label"><i class="icon icon-circle-blank"></i> 计为加班费/调休(员工自行选择)</span></td>
                                                                <td>
                                                                    <div class="input-group pull-left">
                                                                        <span class="input-group-addon">调休比例 1：</span>
                                                                        <input type="number" class="form-control" readonly>
                                                                    </div>
                                                                </td>
                                                            </tr>
                                                        </table>
                                                    </dd>
                                                </dl>
                                            </li>
                                        </ol>
                                    </td>
                                </tr>
                            </tbody>
                        </table>

                    </form>
                    <div class="text-center">
                        <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                        <button type="button" class="btn btn-primary" id="setup_attendance_overtime_add_submit">提交</button>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <!-- setup_attendance_overtime_add_box -->

    <!-- 基础盒子 -->
    <div class="modal modal-for-page fade" aria-hidden="false" id="setup_attendance_overtime_base_box">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">关闭</span></button>
                    <h4 class="modal-title">加班基础设置</h4>
                </div>
                <div class="modal-body">
                    <form class="container form-horizontal">
                        <div class="form-group require">
                            <label class="col-sm-3 required" for="setup_attendance_overtime_base_hour">日时长折算</label>
                            <div class="col-sm-8">
                                <div class="input-group">
                                    <input type="number" class="form-control" id="setup_attendance_overtime_base_hour">
                                    <span class="input-group-addon">小时 = <b>1天</b></span>
                                </div>
                                <div class="form-control-static">
                                    切换单位或加班转调休时使用，修改后使用加班、请假、出差、外出的日时长折算也会更改
                                </div>
                            </div>
                        </div>
                        <div class="form-group require">
                            <label class="col-sm-3 required" for="setup_attendance_overtime_base_unit">最小加班单位</label>
                            <div class="col-sm-8">
                                <select class="form-control" id="setup_attendance_overtime_base_unit">
                                    <option value="1">按照半小时加班</option>
                                    <option value="2">按照小时加班</option>
                                    <option value="3">按照半天加班</option>
                                    <option value="4">按照整天加班</option>
                                </select>
                                <div class="form-control-static">
                                    <table class="table table-bordered">
                                        <tr>
                                            <td>按照半小时加班</td>
                                            <td>员工加班时长，以半小时为计算单位，不足的不计算</td>
                                            <td>1.82小时=1.5小时</td>
                                            <td>考勤按小时统计报表</td>
                                        </tr>
                                        <tr>
                                            <td>按照小时加班</td>
                                            <td>员工加班时长，以小时为计算单位，不足的不计算</td>
                                            <td>1.82小时=1小时</td>
                                            <td>考勤按小时统计报表</td>
                                        </tr>
                                        <tr>
                                            <td>按照半天加班</td>
                                            <td>员工加班时长，以半天为计算单位，不足的不计算</td>
                                            <td>1.82天=1.5天</td>
                                            <td>考勤按天统计报表</td>
                                        </tr>
                                        <tr>
                                            <td>按照整天加班</td>
                                            <td>员工加班时长，以天为计算单位，不足的不计算</td>
                                            <td>1.82天=1天</td>
                                            <td>考勤按天统计报表</td>
                                        </tr>
                                    </table>
                                </div>
                            </div>
                        </div>
                    </form>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                    <button type="button" class="btn btn-primary"  id="setup_attendance_overtime_base_submit">提交</button>
                </div>
            </div>
        </div>
    </div>
    <!-- setup_attendance_overtime_base_box -->

    <!-- 修改盒子 -->
    <div class="modal modal-for-page fade" aria-hidden="false" id="setup_attendance_overtime_edit_box">
        <div class="modal-dialog modal-fullscreen">
            <div class="modal-content">
                <div class="modal-header">
                    <button class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">关闭</span></button>
                    <h4 class="modal-title">修改</h4>
                </div>
                <div class="modal-body">
                    <form class="container form-horizontal">

                        <!-- 规则名称 -->
                        <table class="table table-bordered setup_attendance_overtime_table">
                            <thead><tr><th><span>规则名称</span></th></tr></thead>
                            <tbody><tr><td>
                                <div class="col-sm-3"><input type="text" class="form-control" id="setup_attendance_overtime_edit_name"></div>
                            </td></tr></tbody>
                        </table>
                        <!-- 工作日加班 -->
                        <table class="table table-bordered setup_attendance_overtime_table">
                            <thead>
                                <tr>
                                    <th>
                                        <span>工作日加班</span>
                                        <div class="btn-group pull-right" data-toggle="buttons">
                                            <label class="btn btn-mini btn-default active"><input type="radio">启用</label>
                                            <label class="btn btn-mini btn-default"><input type="radio">禁用</label>
                                        </div>
                                    </th>
                                </tr>
                            </thead>
                            <tbody>
                                <tr>
                                    <td>
                                        <div class="table-disabled-mask"></div>
                                        <ul radio="1" time1="" time2="" id="setup_attendance_overtime_edit_table1_ul">
                                            <li>
                                                <dl><dt><span class="for-label"><i class="icon icon-dot-circle"></i> 需要审批，以批准单为准</span></dt></dl>
                                            </li>
                                            <li>
                                                <dl>
                                                    <dt><span class="for-label"><i class="icon icon-circle-blank"></i> 需要审批，以打卡时间为准，但是不能超过审批单时长</span></dt>
                                                    <dd>
                                                        <div class="input-group pull-left">
                                                            <span class="input-group-addon">加班起算时间</span>
                                                            <input type="number" class="form-control" readonly>
                                                            <span class="input-group-addon">分钟</span>
                                                        </div>
                                                        <div class="small text-muted pull-left">最后一次下班时间超过该分钟数后，开始计算加班</div>
                                                        <div class="clearfix"></div>
                                                    </dd>
                                                    <dd>
                                                        <div class="input-group pull-left">
                                                            <span class="input-group-addon">最小加班时长</span>
                                                            <input type="number" class="form-control" readonly>
                                                            <span class="input-group-addon">分钟</span>
                                                        </div>
                                                        <div class="small text-muted pull-left">分钟小于该时长则加班时长记为0</div>
                                                        <div class="clearfix"></div>
                                                    </dd>
                                                </dl>
                                            </li>
                                            <li>
                                                <dl>
                                                    <dt><span class="for-label"><i class="icon icon-circle-blank"></i> 无需审批，根据打卡时间算加班时间</span></dt>
                                                    <dd>
                                                        <div class="input-group pull-left">
                                                            <span class="input-group-addon">加班起算时间</span>
                                                            <input type="number" class="form-control" readonly>
                                                            <span class="input-group-addon">分钟</span>
                                                        </div>
                                                        <div class="small text-muted pull-left">最后一次下班时间超过该分钟数后，开始计算加班</div>
                                                        <div class="clearfix"></div>
                                                    </dd>
                                                    <dd>
                                                        <div class="input-group pull-left">
                                                            <span class="input-group-addon">最小加班时长</span>
                                                            <input type="number" class="form-control" readonly>
                                                            <span class="input-group-addon">分钟</span>
                                                        </div>
                                                        <div class="small text-muted pull-left">分钟小于该时长则加班时长记为0</div>
                                                        <div class="clearfix"></div>
                                                    </dd>
                                                </dl>
                                            </li>
                                        </ul>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <div class="table-disabled-mask"></div>
                                        <ol>
                                            <li>
                                                <dl>
                                                    <dt>
                                                        <span class="for-label" id="setup_attendance_overtime_edit_table1_ol_check1">
                                                            <i class="icon icon-check-empty"></i> 
                                                            扣除休息时间
                                                        </span>
                                                    </dt>
                                                    <dd>
                                                        <div class="input-group pull-left">
                                                            <input type="time" class="form-control" id="setup_attendance_overtime_edit_table1_ol_duration1" readonly>
                                                            <span class="input-group-addon">至</span>
                                                            <input type="time" class="form-control" id="setup_attendance_overtime_edit_table1_ol_duration2" readonly>
                                                        </div>
                                                        <div class="clearfix"></div>
                                                    </dd>
                                                </dl>
                                            </li>
                                            <li>
                                                <dl>
                                                    <dt>
                                                        <span class="for-label has-table" id="setup_attendance_overtime_edit_table1_ol_check2">
                                                            <i class="icon icon-check-empty"></i> 
                                                            计为加班费/调休
                                                        </span>
                                                    </dt>
                                                    <dd>
                                                        <table class="table" radio="" time="" id="setup_attendance_overtime_edit_table1_ol_table">
                                                            <tr>
                                                                <td colspan="2">
                                                                    <span class="for-label"><i class="icon icon-circle-blank"></i> 计为加班费</span>
                                                                </td>
                                                            </tr>
                                                            <tr>
                                                                <td style="width:220px;"><span class="for-label"><i class="icon icon-circle-blank"></i> 计为调休时长</span></td>
                                                                <td>
                                                                    <div class="input-group pull-left">
                                                                        <span class="input-group-addon">调休比例 1：</span>
                                                                        <input type="number" class="form-control" readonly>
                                                                    </div>
                                                                </td>
                                                            </tr>
                                                            <tr>
                                                                <td><span class="for-label"><i class="icon icon-circle-blank"></i> 计为加班费/调休(员工自行选择)</span></td>
                                                                <td>
                                                                    <div class="input-group pull-left">
                                                                        <span class="input-group-addon">调休比例 1：</span>
                                                                        <input type="number" class="form-control" readonly>
                                                                    </div>
                                                                </td>
                                                            </tr>
                                                        </table>
                                                    </dd>
                                                </dl>
                                            </li>
                                        </ol>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                        <!-- 休息日加班 -->
                        <table class="table table-bordered setup_attendance_overtime_table">
                            <thead>
                                <tr>
                                    <th>
                                        <span>休息日加班</span>
                                        <div class="btn-group pull-right" data-toggle="buttons">
                                            <label class="btn btn-mini btn-default active"><input type="radio">启用</label>
                                            <label class="btn btn-mini btn-default"><input type="radio">禁用</label>
                                        </div>
                                    </th>
                                </tr>
                            </thead>
                            <tbody>
                                <tr>
                                    <td>
                                        <div class="table-disabled-mask"></div>
                                        <ul radio="1" time1="" time2="" id="setup_attendance_overtime_edit_table2_ul">
                                            <li>
                                                <dl><dt><span class="for-label"><i class="icon icon-dot-circle"></i> 需要审批，以批准单为准</span></dt></dl>
                                            </li>
                                            <li>
                                                <dl>
                                                    <dt><span class="for-label"><i class="icon icon-circle-blank"></i> 需要审批，以打卡时间为准，但是不能超过审批单时长</span></dt>
                                                    <dd>
                                                        <div class="input-group pull-left">
                                                            <span class="input-group-addon">最小加班时长</span>
                                                            <input type="number" class="form-control" readonly>
                                                            <span class="input-group-addon">分钟</span>
                                                        </div>
                                                        <div class="small text-muted pull-left">当天加班少于该分钟数不计入加班</div>
                                                        <div class="clearfix"></div>
                                                    </dd>
                                                </dl>
                                            </li>
                                            <li>
                                                <dl>
                                                    <dt><span class="for-label"><i class="icon icon-circle-blank"></i> 无需审批，根据打卡时间算加班时间</span></dt>
                                                    <dd>
                                                        <div class="input-group pull-left">
                                                            <span class="input-group-addon">最小加班时长</span>
                                                            <input type="number" class="form-control" readonly>
                                                            <span class="input-group-addon">分钟</span>
                                                        </div>
                                                        <div class="small text-muted pull-left">当天加班少于该分钟数不计入加班</div>
                                                        <div class="clearfix"></div>
                                                    </dd>
                                                </dl>
                                            </li>
                                        </ul>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <div class="table-disabled-mask"></div>
                                        <ol>
                                            <li>
                                                <dl>
                                                    <dt>
                                                        <span class="for-label" id="setup_attendance_overtime_edit_table2_ol_check1">
                                                            <i class="icon icon-check-empty"></i> 
                                                            扣除休息时间
                                                        </span>
                                                    </dt>
                                                    <dd>
                                                        <div class="input-group pull-left">
                                                            <input type="time" class="form-control" id="setup_attendance_overtime_edit_table2_ol_duration1" readonly>
                                                            <span class="input-group-addon">至</span>
                                                            <input type="time" class="form-control" id="setup_attendance_overtime_edit_table2_ol_duration2" readonly>
                                                        </div>
                                                        <div class="clearfix"></div>
                                                    </dd>
                                                </dl>
                                            </li>
                                            <li>
                                                <dl>
                                                    <dt>
                                                        <span class="for-label has-table" id="setup_attendance_overtime_edit_table2_ol_check2">
                                                            <i class="icon icon-check-empty"></i> 
                                                            计为加班费/调休
                                                        </span>
                                                    </dt>
                                                    <dd>
                                                        <table class="table" radio="" time="" id="setup_attendance_overtime_edit_table2_ol_table">
                                                            <tr>
                                                                <td colspan="2">
                                                                    <span class="for-label"><i class="icon icon-circle-blank"></i> 计为加班费</span>
                                                                </td>
                                                            </tr>
                                                            <tr>
                                                                <td style="width:220px;"><span class="for-label"><i class="icon icon-circle-blank"></i> 计为调休时长</span></td>
                                                                <td>
                                                                    <div class="input-group pull-left">
                                                                        <span class="input-group-addon">调休比例 1：</span>
                                                                        <input type="number" class="form-control" readonly>
                                                                    </div>
                                                                </td>
                                                            </tr>
                                                            <tr>
                                                                <td><span class="for-label"><i class="icon icon-circle-blank"></i> 计为加班费/调休(员工自行选择)</span></td>
                                                                <td>
                                                                    <div class="input-group pull-left">
                                                                        <span class="input-group-addon">调休比例 1：</span>
                                                                        <input type="number" class="form-control" readonly>
                                                                    </div>
                                                                </td>
                                                            </tr>
                                                        </table>
                                                    </dd>
                                                </dl>
                                            </li>
                                        </ol>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                        <!-- 节假日加班 -->
                        <table class="table table-bordered setup_attendance_overtime_table">
                            <thead>
                                <tr>
                                    <th>
                                        <span>节假日加班</span>
                                        <small class="text-danger" style="font-weight:normal;">&nbsp; 注：节假日指节日当天（如5月1日、10月1日等）</small>
                                        <div class="btn-group pull-right" data-toggle="buttons">
                                            <label class="btn btn-mini btn-default active"><input type="radio">启用</label>
                                            <label class="btn btn-mini btn-default"><input type="radio">禁用</label>
                                        </div>
                                    </th>
                                </tr>
                            </thead>
                            <tbody>
                                <tr>
                                    <td>
                                        <div class="table-disabled-mask"></div>
                                        <ul radio="1" time1="" time2="" id="setup_attendance_overtime_edit_table3_ul">
                                            <li>
                                                <dl><dt><span class="for-label"><i class="icon icon-dot-circle"></i> 需要审批，以批准单为准</span></dt></dl>
                                            </li>
                                            <li>
                                                <dl>
                                                    <dt><span class="for-label"><i class="icon icon-circle-blank"></i> 需要审批，以打卡时间为准，但是不能超过审批单时长</span></dt>
                                                    <dd>
                                                        <div class="input-group pull-left">
                                                            <span class="input-group-addon">最小加班时长</span>
                                                            <input type="number" class="form-control" readonly>
                                                            <span class="input-group-addon">分钟</span>
                                                        </div>
                                                        <div class="small text-muted pull-left">当天加班少于该分钟数不计入加班</div>
                                                        <div class="clearfix"></div>
                                                    </dd>
                                                </dl>
                                            </li>
                                            <li>
                                                <dl>
                                                    <dt><span class="for-label"><i class="icon icon-circle-blank"></i> 无需审批，根据打卡时间算加班时间</span></dt>
                                                    <dd>
                                                        <div class="input-group pull-left">
                                                            <span class="input-group-addon">最小加班时长</span>
                                                            <input type="number" class="form-control" readonly>
                                                            <span class="input-group-addon">分钟</span>
                                                        </div>
                                                        <div class="small text-muted pull-left">当天加班少于该分钟数不计入加班</div>
                                                        <div class="clearfix"></div>
                                                    </dd>
                                                </dl>
                                            </li>
                                        </ul>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <div class="table-disabled-mask"></div>
                                        <ol>
                                            <li>
                                                <dl>
                                                    <dt>
                                                        <span class="for-label" id="setup_attendance_overtime_edit_table3_ol_check1">
                                                            <i class="icon icon-check-empty"></i> 
                                                            扣除休息时间
                                                        </span>
                                                    </dt>
                                                    <dd>
                                                        <div class="input-group pull-left">
                                                            <input type="time" class="form-control" id="setup_attendance_overtime_edit_table3_ol_duration1" readonly>
                                                            <span class="input-group-addon">至</span>
                                                            <input type="time" class="form-control" id="setup_attendance_overtime_edit_table3_ol_duration2" readonly>
                                                        </div>
                                                        <div class="clearfix"></div>
                                                    </dd>
                                                </dl>
                                            </li>
                                            <li>
                                                <dl>
                                                    <dt>
                                                        <span class="for-label has-table" id="setup_attendance_overtime_edit_table3_ol_check2">
                                                            <i class="icon icon-check-empty"></i> 
                                                            计为加班费/调休
                                                        </span>
                                                    </dt>
                                                    <dd>
                                                        <table class="table" radio="" time="" id="setup_attendance_overtime_edit_table3_ol_table">
                                                            <tr>
                                                                <td colspan="2">
                                                                    <span class="for-label"><i class="icon icon-circle-blank"></i> 计为加班费</span>
                                                                </td>
                                                            </tr>
                                                            <tr>
                                                                <td style="width:220px;"><span class="for-label"><i class="icon icon-circle-blank"></i> 计为调休时长</span></td>
                                                                <td>
                                                                    <div class="input-group pull-left">
                                                                        <span class="input-group-addon">调休比例 1：</span>
                                                                        <input type="number" class="form-control" readonly>
                                                                    </div>
                                                                </td>
                                                            </tr>
                                                            <tr>
                                                                <td><span class="for-label"><i class="icon icon-circle-blank"></i> 计为加班费/调休(员工自行选择)</span></td>
                                                                <td>
                                                                    <div class="input-group pull-left">
                                                                        <span class="input-group-addon">调休比例 1：</span>
                                                                        <input type="number" class="form-control" readonly>
                                                                    </div>
                                                                </td>
                                                            </tr>
                                                        </table>
                                                    </dd>
                                                </dl>
                                            </li>
                                        </ol>
                                    </td>
                                </tr>
                            </tbody>
                        </table>

                    </form>
                    <div class="text-center">
                        <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                        <button type="button" class="btn btn-primary" id="setup_attendance_overtime_edit_submit">提交</button>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <!-- setup_attendance_overtime_edit_box -->

    <!-- 删除盒子 -->
    <div class="modal modal-for-page fade" aria-hidden="false" id="setup_attendance_overtime_dele_box">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">关闭</span></button>
                    <h4 class="modal-title">删除</h4>
                </div>
                <div class="modal-body">
                    <p class="text-danger"><i class="icon icon-warning-sign"></i> 是否删除？</p>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                    <button type="button" class="btn btn-danger"  id="setup_attendance_overtime_dele_submit">提交</button>
                </div>
            </div>
        </div>
    </div>
    <!-- setup_attendance_overtime_dele_box -->

</div>
<!-- page-wrapper -->

<script>
$(function(){
   
    //变量声明-----------------------------------------------------------------------------------------------
    var 
    setup_attendance_overtime               = $("#setup_attendance_overtime"),              //页面ID
    setup_attendance_overtime_datagrid      = $("#setup_attendance_overtime_datagrid"),     //数据表格
    //添加
    setup_attendance_overtime_add_btn       = $("#setup_attendance_overtime_add_btn"),      //添加按钮
    setup_attendance_overtime_add_box       = $("#setup_attendance_overtime_add_box"),      //添加盒子
    setup_attendance_overtime_add_submit    = $("#setup_attendance_overtime_add_submit"),   //添加提交
    //基础盒子
    setup_attendance_overtime_base_btn      = $("#setup_attendance_overtime_base_btn"),     //基础按钮
    setup_attendance_overtime_base_box      = $("#setup_attendance_overtime_base_box"),     //基础盒子
    setup_attendance_overtime_base_submit   = $("#setup_attendance_overtime_base_submit"),  //基础提交
    setup_attendance_overtime_base_hour     = $("#setup_attendance_overtime_base_hour"),    //基础小时
    setup_attendance_overtime_base_unit     = $("#setup_attendance_overtime_base_unit"),    //基础单位
    //修改
    setup_attendance_overtime_edit_box      = $("#setup_attendance_overtime_edit_box"),     //修改盒子
    setup_attendance_overtime_edit_submit   = $("#setup_attendance_overtime_edit_submit"),  //修改提交
    //删除
    setup_attendance_overtime_dele_box      = $("#setup_attendance_overtime_dele_box"),     //删除盒子
    setup_attendance_overtime_dele_submit   = $("#setup_attendance_overtime_dele_submit");  //删除提交
    
    //数据声明-----------------------------------------------------------------------------------------------
    //添加
    var 
    //标题
    setup_attendance_overtime_add_name               = $("#setup_attendance_overtime_add_name"),
    //表格1
    setup_attendance_overtime_add_table1_ul          = $("#setup_attendance_overtime_add_table1_ul"),
    setup_attendance_overtime_add_table1_ol_check1   = $("#setup_attendance_overtime_add_table1_ol_check1"),
    setup_attendance_overtime_add_table1_ol_duration1= $("#setup_attendance_overtime_add_table1_ol_duration1"),
    setup_attendance_overtime_add_table1_ol_duration2= $("#setup_attendance_overtime_add_table1_ol_duration2"),
    setup_attendance_overtime_add_table1_ol_check2   = $("#setup_attendance_overtime_add_table1_ol_check2"),
    setup_attendance_overtime_add_table1_ol_table    = $("#setup_attendance_overtime_add_table1_ol_table"),
    //表格2
    setup_attendance_overtime_add_table2_ul          = $("#setup_attendance_overtime_add_table2_ul"),
    setup_attendance_overtime_add_table2_ol_check1   = $("#setup_attendance_overtime_add_table2_ol_check1"),
    setup_attendance_overtime_add_table2_ol_duration1= $("#setup_attendance_overtime_add_table2_ol_duration1"),
    setup_attendance_overtime_add_table2_ol_duration2= $("#setup_attendance_overtime_add_table2_ol_duration2"),
    setup_attendance_overtime_add_table2_ol_check2   = $("#setup_attendance_overtime_add_table2_ol_check2"),
    setup_attendance_overtime_add_table2_ol_table    = $("#setup_attendance_overtime_add_table2_ol_table"),
    //表格3
    setup_attendance_overtime_add_table3_ul          = $("#setup_attendance_overtime_add_table3_ul"),
    setup_attendance_overtime_add_table3_ol_check1   = $("#setup_attendance_overtime_add_table3_ol_check1"),
    setup_attendance_overtime_add_table3_ol_duration1= $("#setup_attendance_overtime_add_table3_ol_duration1"),
    setup_attendance_overtime_add_table3_ol_duration2= $("#setup_attendance_overtime_add_table3_ol_duration2"),
    setup_attendance_overtime_add_table3_ol_check2   = $("#setup_attendance_overtime_add_table3_ol_check2"),
    setup_attendance_overtime_add_table3_ol_table    = $("#setup_attendance_overtime_add_table3_ol_table");
    //修改
    var 
    //标题
    setup_attendance_overtime_edit_name               = $("#setup_attendance_overtime_edit_name"),
    //表格1
    setup_attendance_overtime_edit_table1_ul          = $("#setup_attendance_overtime_edit_table1_ul"),
    setup_attendance_overtime_edit_table1_ol_check1   = $("#setup_attendance_overtime_edit_table1_ol_check1"),
    setup_attendance_overtime_edit_table1_ol_duration1= $("#setup_attendance_overtime_edit_table1_ol_duration1"),
    setup_attendance_overtime_edit_table1_ol_duration2= $("#setup_attendance_overtime_edit_table1_ol_duration2"),
    setup_attendance_overtime_edit_table1_ol_check2   = $("#setup_attendance_overtime_edit_table1_ol_check2"),
    setup_attendance_overtime_edit_table1_ol_table    = $("#setup_attendance_overtime_edit_table1_ol_table"),
    //表格2
    setup_attendance_overtime_edit_table2_ul          = $("#setup_attendance_overtime_edit_table2_ul"),
    setup_attendance_overtime_edit_table2_ol_check1   = $("#setup_attendance_overtime_edit_table2_ol_check1"),
    setup_attendance_overtime_edit_table2_ol_duration1= $("#setup_attendance_overtime_edit_table2_ol_duration1"),
    setup_attendance_overtime_edit_table2_ol_duration2= $("#setup_attendance_overtime_edit_table2_ol_duration2"),
    setup_attendance_overtime_edit_table2_ol_check2   = $("#setup_attendance_overtime_edit_table2_ol_check2"),
    setup_attendance_overtime_edit_table2_ol_table    = $("#setup_attendance_overtime_edit_table2_ol_table"),
    //表格3
    setup_attendance_overtime_edit_table3_ul          = $("#setup_attendance_overtime_edit_table3_ul"),
    setup_attendance_overtime_edit_table3_ol_check1   = $("#setup_attendance_overtime_edit_table3_ol_check1"),
    setup_attendance_overtime_edit_table3_ol_duration1= $("#setup_attendance_overtime_edit_table3_ol_duration1"),
    setup_attendance_overtime_edit_table3_ol_duration2= $("#setup_attendance_overtime_edit_table3_ol_duration2"),
    setup_attendance_overtime_edit_table3_ol_check2   = $("#setup_attendance_overtime_edit_table3_ol_check2"),
    setup_attendance_overtime_edit_table3_ol_table    = $("#setup_attendance_overtime_edit_table3_ol_table");

    //接口对象-----------------------------------------------------------------------------------------------
    if( window.STATE == "local" ){

        //本地接口
        var setup_attendance_overtime_api = {
            datagrid   : LOCAL + "Test/test_datagrid.json",                                     //数据表格
            modal_edit : LOCAL + "Test/Setup/Attendance/overtime_edit.json",                    //修改盒子
        }

    } else if ( window.STATE == "route" ){

        //远程接口
        var setup_attendance_overtime_api = {
            datagrid   : LOCAL + "Test/test_datagrid.json",                                     //数据表格
            modal_edit : LOCAL + "Test/Setup/Attendance/overtime_edit.json",                    //修改盒子
        }

    }

    //数据表格-----------------------------------------------------------------------------------------------
    setup_attendance_overtime_datagrid.datagrid({
        height      : zui_datagrid_height(setup_attendance_overtime_datagrid),
        sortable    : false,
        cache       : false,
        showRowIndex: true,
        configs     : {
            R0:{className:"text-center"},
            C1:{className:"cell-hidden"}
        },
        states      : {
            pager           : {
                page        : 1,
                recPerPage  : window.REC_PER_PAGE,
            }
        },
        dataSource : {
            cols   : [
                {name:"id",      label:"ID",          width:49 },
                {name:"tex10",   label:"加班规则名称",width:200},
                {name:"state",   label:"操作",        width:150,
                    html:true,
                    valueOperator : {
                        getter : function(dataValue,cell){
                            var temp = `
                                <a class="setup_attendance_overtime_edit_btn" rowIndex="${cell.rowIndex}">修改</a>
                                <a class="setup_attendance_overtime_dele_btn" rowIndex="${cell.rowIndex}">删除</a>
                            `;
                            if( dataValue=="1" ){
                                temp += `<a class="setup_attendance_overtime_deal_btn" rowIndex="${cell.rowIndex}" type="1">启用</a>`;
                            } else {
                                temp += `<a class="setup_attendance_overtime_deal_btn" rowIndex="${cell.rowIndex}" type="0">禁用</a>`;
                            }
                            return temp;
                        }
                    }
                }
            ],
            remote : function(){
                return {
                    url     : setup_attendance_overtime_api.datagrid,
                    type    : "POST",
                    dataType: "json",
                }
            }
        }
    });

    //变量声明-----------------------------------------------------------------------------------------------
    var
    setup_attendance_overtime_datagrid_obj   = setup_attendance_overtime_datagrid.data("zui.datagrid"),   //表格对象
    setup_attendance_overtime_edit_btn       = ".setup_attendance_overtime_edit_btn",                     //修改按钮
    setup_attendance_overtime_dele_btn       = ".setup_attendance_overtime_dele_btn",                     //删除按钮
    setup_attendance_overtime_deal_btn       = ".setup_attendance_overtime_deal_btn";                     //操作按钮

    //基本按钮-----------------------------------------------------------------------------------------------
    setup_attendance_overtime_base_btn.click(function(){
        setup_attendance_overtime_base_box.modal("show");
    });
    //基本提交
    setup_attendance_overtime_base_submit.click(function(){
 
        //远程提交
        $.ajax({
            url     : API.test_response,
            type    : "post",
            dataType: "json",
            data    : {
                hour : setup_attendance_overtime_base_hour.val(),
                unit : setup_attendance_overtime_base_unit.val(),
            },
            success : function(data){
                if( data.status>0 ){
                    um_tip(data.message);
                    zui_datagrid_reset(setup_attendance_overtime_datagrid_obj,setup_attendance_overtime_api.datagrid);
                } else {
                    um_tip(data.message,"1500","text-danger");
                }
            }
        });

    });

    //添加按钮-----------------------------------------------------------------------------------------------
    setup_attendance_overtime_add_btn.click(function(){
        common_form_reset();
        setup_attendance_overtime_add_box.find("table .btn-group .btn:first-child").trigger("click");     //数据复原
        setup_attendance_overtime_add_box.modal("show");
    });
    //添加提交
    setup_attendance_overtime_add_submit.click(function(){
 
        //远程提交
        $.ajax({
            url     : API.test_response,
            type    : "post",
            dataType: "json",
            data    : {
                //标题
                name                : setup_attendance_overtime_add_name.val(),
                //表格1
                table1_radio        : setup_attendance_overtime_add_table1_ul.attr("radio"),
                table1_time1        : setup_attendance_overtime_add_table1_ul.attr("time1"),
                table1_time2        : setup_attendance_overtime_add_table1_ul.attr("time2"),
                table1_check1       : setup_attendance_overtime_add_table1_ol_check1.find(".icon").hasClass("icon-checked"),
                table1_durat1       : setup_attendance_overtime_add_table1_ol_duration1.val(),
                table1_durat2       : setup_attendance_overtime_add_table1_ol_duration2.val(),
                table1_check2       : setup_attendance_overtime_add_table1_ol_check2.find(".icon").hasClass("icon-checked"),
                table1_table_radio  : setup_attendance_overtime_add_table1_ol_table.attr("radio"),
                table1_table_time   : setup_attendance_overtime_add_table1_ol_table.attr("time"),
                //表格2
                table2_radio        : setup_attendance_overtime_add_table2_ul.attr("radio"),
                table2_time1        : setup_attendance_overtime_add_table2_ul.attr("time1"),
                table2_check1       : setup_attendance_overtime_add_table2_ol_check1.find(".icon").hasClass("icon-checked"),
                table2_durat1       : setup_attendance_overtime_add_table2_ol_duration1.val(),
                table2_durat2       : setup_attendance_overtime_add_table2_ol_duration2.val(),
                table2_check2       : setup_attendance_overtime_add_table2_ol_check2.find(".icon").hasClass("icon-checked"),
                table2_table_radio  : setup_attendance_overtime_add_table2_ol_table.attr("radio"),
                table2_table_time   : setup_attendance_overtime_add_table2_ol_table.attr("time"),
                //表格3
                table3_radio        : setup_attendance_overtime_add_table3_ul.attr("radio"),
                table3_time1        : setup_attendance_overtime_add_table3_ul.attr("time1"),
                table3_check1       : setup_attendance_overtime_add_table3_ol_check1.find(".icon").hasClass("icon-checked"),
                table3_durat1       : setup_attendance_overtime_add_table3_ol_duration1.val(),
                table3_durat2       : setup_attendance_overtime_add_table3_ol_duration2.val(),
                table3_check2       : setup_attendance_overtime_add_table3_ol_check2.find(".icon").hasClass("icon-checked"),
                table3_table_radio  : setup_attendance_overtime_add_table3_ol_table.attr("radio"),
                table3_table_time   : setup_attendance_overtime_add_table3_ol_table.attr("time"),
            },
            success : function(data){
                if( data.status>0 ){
                    um_tip(data.message);
                    zui_datagrid_reset(setup_attendance_overtime_datagrid_obj,setup_attendance_overtime_api.datagrid);
                } else {
                    um_tip(data.message,"1500","text-danger");
                }
            }
        });

    });

    //修改按钮-----------------------------------------------------------------------------------------------
    $(document).on("click",setup_attendance_overtime_edit_btn,function(){
  
        //数据ID
        var data_id    = zui_datagrid_get_id($(this).attr("rowIndex"));

        //远程提交
        $.ajax({
            url     : setup_attendance_overtime_api.modal_edit,
            type    : "post",
            dataType: "json",
            data    : { id:data_id },
            success : function(data){
                if( data.status>0 ){
                    var data = data.data;
                    //数据复原
                    setup_attendance_overtime_edit_box.find("table .btn-group .btn:first-child").trigger("click");
                    //数据赋值
                    setup_attendance_overtime_edit_name.val( data.name );
                    //表格1
                    setup_attendance_overtime_edit_table1_ul.find("li").eq( data.table1_radio-1 ).find("span").trigger("click");
                    setup_attendance_overtime_edit_table1_ul.find("li").eq( data.table1_radio-1 ).find("dd").eq(0).find("input").val( data.table1_time1 );
                    setup_attendance_overtime_edit_table1_ul.find("li").eq( data.table1_radio-1 ).find("dd").eq(1).find("input").val( data.table1_time2 );
                    setup_attendance_overtime_edit_table1_ul.attr("radio",data.table1_radio);
                    setup_attendance_overtime_edit_table1_ul.attr("time1",data.table1_time1);
                    setup_attendance_overtime_edit_table1_ul.attr("time2",data.table1_time2);
                    if( data.table1_check1==true ){ 
                        setup_attendance_overtime_edit_table1_ol_check1.trigger("click");
                        setup_attendance_overtime_edit_table1_ol_duration1.val( data.table1_durat1 );
                        setup_attendance_overtime_edit_table1_ol_duration2.val( data.table1_durat2 );
                    }
                    if( data.table1_check2==true ){
                        setup_attendance_overtime_edit_table1_ol_table.find("tr").eq( data.table1_table_radio-1 ).find("span").trigger("click");
                        setup_attendance_overtime_edit_table1_ol_table.find("tr").eq( data.table1_table_radio-1 ).find("input").val( data.table1_table_time );
                        setup_attendance_overtime_edit_table1_ol_table.attr("radio",data.table1_table_radio);
                        setup_attendance_overtime_edit_table1_ol_table.attr("time" ,data.table1_table_time );                        
                    }
                    //表格2
                    setup_attendance_overtime_edit_table2_ul.find("li").eq( data.table2_radio-1 ).find("span").trigger("click");
                    setup_attendance_overtime_edit_table2_ul.find("li").eq( data.table2_radio-1 ).find("dd").eq(0).find("input").val( data.table2_time1 );
                    setup_attendance_overtime_edit_table2_ul.attr("radio",data.table2_radio);
                    setup_attendance_overtime_edit_table2_ul.attr("time1",data.table2_time1);
                    if( data.table2_check1==true ){
                        setup_attendance_overtime_edit_table2_ol_check1.trigger("click");
                        setup_attendance_overtime_edit_table2_ol_duration1.val( data.table2_durat1 );
                        setup_attendance_overtime_edit_table2_ol_duration2.val( data.table2_durat2 );
                    }
                    if( data.table2_check2==true ){ 
                        setup_attendance_overtime_edit_table2_ol_table.find("tr").eq( data.table2_table_radio-1 ).find("span").trigger("click");
                        setup_attendance_overtime_edit_table2_ol_table.find("tr").eq( data.table2_table_radio-1 ).find("input").val( data.table2_table_time );
                        setup_attendance_overtime_edit_table2_ol_table.attr("radio",data.table2_table_radio);
                        setup_attendance_overtime_edit_table2_ol_table.attr("time" ,data.table2_table_time );                        
                    }
                    //表格3
                    setup_attendance_overtime_edit_table3_ul.find("li").eq( data.table3_radio-1 ).find("span").trigger("click");
                    setup_attendance_overtime_edit_table3_ul.find("li").eq( data.table3_radio-1 ).find("dd").eq(0).find("input").val( data.table3_time1 );
                    setup_attendance_overtime_edit_table3_ul.attr("radio",data.table3_radio);
                    setup_attendance_overtime_edit_table3_ul.attr("time1",data.table3_time1);
                    if( data.table3_check1==true ){ 
                        setup_attendance_overtime_edit_table3_ol_check1.trigger("click");
                        setup_attendance_overtime_edit_table3_ol_duration1.val( data.table3_durat1 );
                        setup_attendance_overtime_edit_table3_ol_duration2.val( data.table3_durat2 );
                    }
                    if( data.table3_check2==true ){ 
                        setup_attendance_overtime_edit_table3_ol_table.find("tr").eq( data.table3_table_radio-1 ).find("span").trigger("click");
                        setup_attendance_overtime_edit_table3_ol_table.find("tr").eq( data.table3_table_radio-1 ).find("input").val( data.table3_table_time );
                        setup_attendance_overtime_edit_table3_ol_table.attr("radio",data.table3_table_radio);
                        setup_attendance_overtime_edit_table3_ol_table.attr("time" ,data.table3_table_time );                        
                    }

                    //其他操作
                    setup_attendance_overtime_edit_submit.attr("dataId",data_id);  //数据ID传值
                    setup_attendance_overtime_edit_box.modal("show");              //盒子显示

                } else {
                    um_tip(data.message,"1500","text-danger");
                }
            }
        });

    });

    //修改提交
    setup_attendance_overtime_edit_submit.click(function(){

        //数据ID
        var data_id = $(this).attr("dataId");

        //远程提交
        $.ajax({
            url     : API.test_response,
            type    : "post",
            dataType: "json",
            data    : { 
                id                  : data_id,
                //标题
                name                : setup_attendance_overtime_edit_name.val(),
                //表格1
                table1_radio        : setup_attendance_overtime_edit_table1_ul.attr("radio"),
                table1_time1        : setup_attendance_overtime_edit_table1_ul.attr("time1"),
                table1_time2        : setup_attendance_overtime_edit_table1_ul.attr("time2"),
                table1_check1       : setup_attendance_overtime_edit_table1_ol_check1.find(".icon").hasClass("icon-checked"),
                table1_durat1       : setup_attendance_overtime_edit_table1_ol_duration1.val(),
                table1_durat2       : setup_attendance_overtime_edit_table1_ol_duration2.val(),
                table1_check2       : setup_attendance_overtime_edit_table1_ol_check2.find(".icon").hasClass("icon-checked"),
                table1_table_radio  : setup_attendance_overtime_edit_table1_ol_table.attr("radio"),
                table1_table_time   : setup_attendance_overtime_edit_table1_ol_table.attr("time"),
                //表格2
                table2_radio        : setup_attendance_overtime_edit_table2_ul.attr("radio"),
                table2_time1        : setup_attendance_overtime_edit_table2_ul.attr("time1"),
                table2_check1       : setup_attendance_overtime_edit_table2_ol_check1.find(".icon").hasClass("icon-checked"),
                table2_durat1       : setup_attendance_overtime_edit_table2_ol_duration1.val(),
                table2_durat2       : setup_attendance_overtime_edit_table2_ol_duration2.val(),
                table2_check2       : setup_attendance_overtime_edit_table2_ol_check2.find(".icon").hasClass("icon-checked"),
                table2_table_radio  : setup_attendance_overtime_edit_table2_ol_table.attr("radio"),
                table2_table_time   : setup_attendance_overtime_edit_table2_ol_table.attr("time"),
                //表格3
                table3_radio        : setup_attendance_overtime_edit_table3_ul.attr("radio"),
                table3_time1        : setup_attendance_overtime_edit_table3_ul.attr("time1"),
                table3_check1       : setup_attendance_overtime_edit_table3_ol_check1.find(".icon").hasClass("icon-checked"),
                table3_durat1       : setup_attendance_overtime_edit_table3_ol_duration1.val(),
                table3_durat2       : setup_attendance_overtime_edit_table3_ol_duration2.val(),
                table3_check2       : setup_attendance_overtime_edit_table3_ol_check2.find(".icon").hasClass("icon-checked"),
                table3_table_radio  : setup_attendance_overtime_edit_table3_ol_table.attr("radio"),
                table3_table_time   : setup_attendance_overtime_edit_table3_ol_table.attr("time"),
             },
            success : function(data){
                if( data.status>0 ){
                    um_tip(data.message);
                    zui_datagrid_reset(setup_attendance_overtime_datagrid_obj,setup_attendance_overtime_api.datagrid);
                } else {
                    um_tip(data.message,"1500","text-danger");
                }
            }
        });

    });

    //删除按钮-----------------------------------------------------------------------------------------------
    $(document).on("click",setup_attendance_overtime_dele_btn,function(){

        //数据ID
        var data_id = zui_datagrid_get_id($(this).attr("rowIndex"));

        //其他操作
        setup_attendance_overtime_dele_submit.attr("dataId",data_id);                                //ID传值
        setup_attendance_overtime_dele_box.modal("show");                                            //面板显示

    });
    //删除提交
    setup_attendance_overtime_dele_submit.click(function(){

        //数据ID
        var data_id = $(this).attr("dataId");

        //远程提交
        $.ajax({
            url     : API.test_response,
            type    : "post",
            dataType: "json",
            data    : { id:data_id },
            success : function(data){
                if( data.status>0 ){
                    um_tip(data.message);
                    zui_datagrid_reset(setup_attendance_overtime_datagrid_obj,setup_attendance_overtime_api.datagrid);
                } else {
                    um_tip(data.message,"1500","text-danger");
                }
            }
        });

    });

    //操作按钮-----------------------------------------------------------------------------------------------
    $(document).on("click",setup_attendance_overtime_deal_btn,function(){

        //数据ID
        var data_id = $(this).attr("rowIndex");
        var type    = $(this).attr("type");

        //远程提交
        $.ajax({
            url     : API.test_response,
            type    : "post",
            dataType: "json",
            data    : { 
                id      : data_id,
                type    : type              //0-禁用 1-启用
            },
            success : function(data){
                if( data.status>0 ){
                    um_tip(data.message);
                    zui_datagrid_reset(setup_attendance_overtime_datagrid_obj,setup_attendance_overtime_api.datagrid);
                } else {
                    um_tip(data.message,"1500","text-danger");
                }
            }
        });

    });

    //表格组-变量声明----------------------------------------------------------------------------------------------------
    var
    set_table_name  = ".setup_attendance_overtime_table",       //class
    set_table       = $(set_table_name),                        //表格
    set_able        = set_table.find(".btn-group .btn"),        //按钮
    set_radio       = set_table.find("ul dl dt span.for-label"),//单选
    set_radio_empty = "icon-circle-blank",                      //empty
    set_radio_check = "icon-dot-circle",                        //check
    set_check       = set_table.find("ol dl dt span.for-label"),//复选
    set_check_empty = "icon-check-empty",                       //empty
    set_check_check = "icon-checked",                           //check
    set_radio_son   = set_table.find("table span.for-label");   //单选2

    //表格组-按钮
    set_able.click(function(){
        var text        = $(this).text();
        var mask        = $(this).parents(set_table_name).find(".table-disabled-mask");
        var input       = $(this).parents(set_table_name).find("input");
        var radio       = $(this).parents(set_table_name).find("ul dl dt .icon");
        var radio1      = $(this).parents(set_table_name).find("ul li:first-child dl dt .icon");
        var radio_son   = $(this).parents(set_table_name).find("table tr .icon");
        var check       = $(this).parents(set_table_name).find("ol dl dt .icon");
        var ul          = set_table.find("ul");
        input.val("");
        input.attr("readonly","readonly");
        radio.removeClass(set_radio_check).addClass(set_radio_empty);
        radio_son.removeClass(set_radio_check).addClass(set_radio_empty);
        check.removeClass(set_check_check).addClass(set_check_empty);
        ul.attr("time1","");
        ul.attr("time2","");
        set_table.find("table").attr("radio","");
        set_table.find("table").attr("time","");
        if(text=="启用"){
            mask.fadeOut(200);
            radio1.removeClass(set_radio_empty).addClass(set_radio_check);
            ul.attr("radio",1);
        } else { 
            mask.fadeIn(200);
            ul.attr("radio","");
        }
    });

    //表格组-单选
    set_radio.click(function(){
        var all_inp  = $(this).parents(set_table_name).find("ul input");
        var all_icon = $(this).parents(set_table_name).find("ul dl dt .icon");
        var my_inp   = $(this).parents(set_table_name + " dl").find("dd input");
        var my_icon  = $(this).find(".icon");
        all_inp.val("");
        all_inp.attr("readonly","readonly");
        my_inp.removeAttr("readonly");
        all_icon.removeClass(set_radio_check).addClass(set_radio_empty);
        my_icon.removeClass(set_radio_empty).addClass(set_radio_check);

        //结果处理
        var ul = $(this).parents(set_table_name + " ul");
        var li = $(this).parents(set_table_name + " li");
        var li_index = li.index()+1;
        ul.attr("radio",li_index);
        ul.attr("time1","");
        ul.attr("time2","");
    });

    //表格组-复选
    set_check.click(function(){
        var son_inp  = $(this).parents(set_table_name + " dl").find("input");
            the_inp  = $(this).parents(set_table_name + " dl").find("dd>div input");
        var son_radio= $(this).parents(set_table_name).find("table .icon");
        var the_radio= $(this).parents(set_table_name).find("table tr:first-child .icon");
        var my_icon  = $(this).find(".icon");
        if( my_icon.hasClass(set_check_check) ){
            my_icon.removeClass(set_check_check).addClass(set_check_empty);
            son_inp.val("");
            son_inp.attr("readonly","readonly");
            son_radio.removeClass(set_radio_check).addClass(set_radio_empty);
            if( $(this).hasClass("has-table") ){
                the_radio.removeClass(set_radio_check).addClass(set_radio_empty);
            }
        } else {
            my_icon.removeClass(set_check_empty).addClass(set_check_check);
            the_inp.removeAttr("readonly");
            if( $(this).hasClass("has-table") ){
                the_radio.removeClass(set_radio_empty).addClass(set_radio_check);
            }
        }

    });

    //表格组-表格-单选
    set_radio_son.click(function(){
        var uncle    = $(this).parents(set_table_name + " dl").find("dt .icon");
        var all_inp  = $(this).parents(set_table_name + " table").find("input");
        var my_inp   = $(this).parents(set_table_name + " table tr").find("input");
        var all_icon = $(this).parents(set_table_name + " table").find(".icon");
        var my_icon  = $(this).find(".icon");
        uncle.removeClass(set_check_empty).addClass(set_check_check);
        all_inp.val("");
        all_inp.attr("readonly","readonly");
        my_inp.removeAttr("readonly");
        all_icon.removeClass(set_radio_check).addClass(set_radio_empty);
        my_icon.removeClass(set_radio_empty).addClass(set_radio_check);

        //结果处理
        var tb = $(this).parents(set_table_name + " table");
        var tr = $(this).parents(set_table_name + " table tr");
        var tr_index = tr.index()+1;
        tb.attr("radio",tr_index);
        tb.attr("time","");
    });

    //表格组-单元格1-文本框-结果处理
    set_table.find("ul input").keyup(function(){
        var ul = $(this).parents(set_table_name + " ul");
        var dd = $(this).parents(set_table_name + " dd");
        var dd_index = dd.index();
        if( dd_index==1 ){
            ul.attr("time1",$(this).val());
        } else {
            ul.attr("time2",$(this).val());
        }
    });

    //表格组-单元格2-表格son-文本框-结果处理
    set_table.find("table input").keyup(function(){
        var tb = $(this).parents(set_table_name + " table");
        tb.attr("time",$(this).val());
    });

});//预加载结尾
</script>